{extend name="layout"}

{block name="content"}
	<p><a class="btn btn-primary" 
	href="{:url('admin/category_type/create', ['category_id' =>$Request.param.category_id])}">添加类别</a></p>
	<table class="table table-bordered text-center">
		<thead>
			<th>名称</th>
			<th>所属分类</th>
			<th>操作</th>
		</thead>
		<tbody>
			{foreach $category->type as $v}
				<tr>
					<td>{$v->name}</td>
					<td>{$category->name}</td>
					<td>
						<a href="{:url('admin/category_type/edit', ['id' => $v->id, 'category_id' => $v->category_id])}" class="far fa-edit text-dark"></a>
						<a href="javascript:;" class="far fa-trash-alt text-dark ml-3" data-url="{:url('admin/category_type/delete',['id' => $v->id])}"></a>
					</td>
					</td>
				</tr>
			{/foreach}
		</tbody>
	</table>
{/block}